var t = require("../../../../@babel/runtime/helpers/defineProperty"), e = getApp().globalData.api;

Page({
    data: {
        ruleForm: {
            ordId: null,
            otRemark: null,
            reasonType: 0,
            closeOrdType: 9801
        },
        options: [],
        listShow: !1
    },
    onLoad: function(a) {
        var n = a.orderid || 0, o = this;
        this.setData(t({}, "ruleForm.ordId", n)), e.getPort("cancelCause").then(function(t) {
            o.setData({
                options: t.values,
                listShow: !0
            });
        }, function(t) {
            o.setData({
                listShow: !0
            });
        });
    },
    bingInfo: function(e) {
        var a, n = "ruleForm.".concat(e.currentTarget.dataset.info);
        a = "reasonType" == e.currentTarget.dataset.info ? e.detail.id : e.detail.value, 
        this.setData(t({}, n, a));
    },
    close: function() {
        this.selectComponent("#select").close();
    },
    submit: e.throttle(function(t, a) {
        e.postPort("cancelOrder", t.data.ruleForm).then(function(t) {
            wx.showToast({
                title: "取消成功",
                icon: "none",
                duration: 2e3,
                success: function() {
                    setTimeout(function() {
                        var t = getCurrentPages();
                        t[t.length - 2].setData({
                            param: "newData"
                        }), wx.navigateBack({
                            delta: 1
                        });
                    }, 800);
                }
            });
        }, function(t) {});
    }, 1e3),
    onShow: function() {}
});